package servlet;

import com.google.gson.Gson;
import dao.NewProductRecommendDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@WebServlet(name = "NewProductRecommendServlet", value = "/NewProductRecommendServlet.s")
public class NewProductRecommendServlet extends HttpServlet {
    NewProductRecommendDao dao = new NewProductRecommendDao();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        List<Map<String, Object>> getimage = dao.getImage();
        String json = new Gson().toJson(getimage);
        response.getWriter().print(json);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
